#include <cstdio>
#include <set>
#include <stack>
using std::min;
using std::swap;

const int N = 100005, inf = 0x3f3f3f3f;
int n, m, q, ccid, w[N << 1];
std::multiset<int> set[N];

struct Graph {
  int e_cnt, heads[N << 1];
  struct Edge {
    int v, nxt;
  };
  Edge e[N << 2];
  inline void add(int u, int v) {
    e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
    e[++e_cnt].v = u, e[e_cnt].nxt = heads[v], heads[v] = e_cnt;
  }
} E, G;

namespace RoundSqrTree {

int cnt, dfn[N], low[N];
std::stack<int> stk;

void tarjan(int x) {
  dfn[x] = low[x] = ++cnt;
  stk.push(x);
  for (int i = E.heads[x], v, tmp; i; i = E.e[i].nxt) {
    if (!dfn[v = E.e[i].v]) {
      tarjan(v);
      low[x] = std::min(low[x], low[v]);
      if (low[v] == dfn[x]) {
        ++ccid;
        tmp = 0;
        while (tmp != v) {
          tmp = stk.top();
          stk.pop();
          G.add(ccid, tmp);
          w[ccid] = min(w[ccid], w[tmp]);
        };
        w[ccid] = min(w[ccid], w[x]);
        G.add(x, ccid);
      }
    } else
      low[x] = min(low[x], dfn[v]);
  }
}

}  // namespace RoundSqrTree

namespace TreChaPat {

int cnt, dfn[N << 1], son[N << 1], siz[N << 1], tran[N << 1], fa[N << 1], top[N << 1],
    dep[N << 1];

struct Node {
  int val;
} tr[N << 3];

void dfs1(int x) {
  siz[x] = 1;
  for (int i = G.heads[x], v; i; i = G.e[i].nxt) {
    if ((v = G.e[i].v) != fa[x]) {
      fa[v] = x, dep[v] = dep[x] + 1;
      dfs1(v);
      if (siz[v] > siz[son[x]]) son[x] = v;
      siz[x] += siz[v];
    }
  }
}

void dfs2(int x) {
  dfn[x] = ++cnt, tran[cnt] = x;
  if (son[x]) top[son[x]] = top[x], dfs2(son[x]);
  for (int i = G.heads[x], v; i; i = G.e[i].nxt) {
    if ((v = G.e[i].v) != fa[x] && v != son[x]) {
      top[v] = v;
      dfs2(v);
    }
  }
}

inline void pushup(const int &x) { tr[x].val = min(tr[x << 1].val, tr[x << 1 | 1].val); }

void build(int x, int l, int r) {
  if (l == r) return tr[x].val = w[tran[l]], void();
  int mid = (l + r) >> 1;
  build(x << 1, l, mid);
  build(x << 1 | 1, mid + 1, r);
  pushup(x);
}

void modify(int x, int l, int r, int pos) {
  if (l == r) return tr[x].val = w[tran[l]], void();
  int mid = (l + r) >> 1;
  if (pos <= mid) modify(x << 1, l, mid, pos);
  else
    modify(x << 1 | 1, mid + 1, r, pos);
  pushup(x);
}

int query(int x, int l, int r, int L, int R) {
  if (L <= l && r <= R) return tr[x].val;
  int mid = (l + r) >> 1, res = inf;
  if (L <= mid) res = min(res, query(x << 1, l, mid, L, R));
  if (mid < R) res = min(res, query(x << 1 | 1, mid + 1, r, L, R));
  return res;
}

inline int query(int x, int y) {
  int res = inf;
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    res = min(res, query(1, 1, ccid, dfn[top[x]], dfn[x]));
    x = fa[top[x]];
  }
  if (dep[x] > dep[y]) swap(x, y);
  res = min(res, query(1, 1, ccid, dfn[x], dfn[y]));
  if (x > n) res = min(res, w[fa[x]]);
  return res;
}

}  // namespace TreChaPat

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("CF487E Tourists.in", "r", stdin);
  freopen("CF487E Tourists.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d", &n, &m, &q);
  ccid = n;
  for (int i = 1; i <= n; ++i) { scanf("%d", &w[i]); }
  for (int i = 1, a, b; i <= m; ++i) {
    scanf("%d%d", &a, &b);
    E.add(a, b);
  }
  RoundSqrTree::tarjan(1);
  TreChaPat::dep[1] = TreChaPat::fa[1] = TreChaPat::top[1] = 1;
  TreChaPat::dfs1(1);
  TreChaPat::dfs2(1);
  for (int i = 2, fa; i <= n; ++i) {
    fa = TreChaPat::fa[i];
    set[fa - n].insert(w[i]);
  }
  for (int i = n + 1; i <= ccid; ++i) { w[i] = *set[i - n].begin(); }
  TreChaPat::build(1, 1, ccid);
  char opt[2];
  for (int a, b, setfa; q; --q) {
    scanf("%s%d%d", opt, &a, &b);
    if (opt[0] == 'C') {
      if (a == 1) {
        w[a] = b;
        TreChaPat::modify(1, 1, ccid, TreChaPat::dfn[a]);
        continue;
      }

      setfa = TreChaPat::fa[a] - n;
      set[setfa].erase(set[setfa].find(w[a]));
      set[setfa].insert(b);
      w[a] = b;
      w[TreChaPat::fa[a]] = *set[setfa].begin();
      TreChaPat::modify(1, 1, ccid, TreChaPat::dfn[a]);
      TreChaPat::modify(1, 1, ccid, TreChaPat::dfn[TreChaPat::fa[a]]);

    } else {
      printf("%d\n", TreChaPat::query(a, b));
    }
  }
  return 0;
}